(defmeth vista-rewcat-proto :compare-models (model1 model2)
"Args: Model1 and model2 are indices of models in the list of models-adjusted-list"
  (when   (send self :nested-model? 
                 (select
                  (send self :model) 
                  model1)
                 (select
                  (send self :model) 
                  model2)) ;I do not know it this is necessary for regression
           (let* (
                  (first-dev (send
                              (select
                               (send self :models-adjusted-list) 
                               model1)
                              :r-squared))
                  (second-dev  (send 
                                (select
                                 (send v-log-lin-proto :models-adjusted-list) 
                                 model2)
                                :r-squared))
                  (first-coefs (send 
                                (select
                                 (send self :models-adjusted-list) 
                                 model1)
                                :num-coefs))
                  (second-coefs (send 
                                 (select
                                  (send self :models-adjusted-list) 
                                  model2)
                                 :num-coefs))
                  (dif (- first-dev second-dev));this test is not correct I have to check it
                  (chi (if (= dif 0) 
                           1
                           (- 1 (chisq-cdf (abs dif)
                                           (abs (- first-coefs second-coefs))))))))
          (list dif chi)))


(defmeth vista-rewcat-proto :floating-window ()
  

  
  
     #| (defmeth w :update-plotcell (&rest args)
      (let* (
             (args args)
             (selection (combine (third args)))
		 (cur-model (send v-rewcat-proto :curr-model))
		(vistaloglinearobject vista-RewCat-proto)
             (dev (send 
             	                cur-model
                  	         :deviance))
	       (chi (send 
             	              cur-model
                  	         :chi))
		(fitted-zeros (send cur-model :fitted-zeros))
		(df (send cur-model :df))
             ;(df-cor (send cur-model :efective-df))
	      (p-chi (- 1 (if (= df 0) 0 (chisq-cdf chi df))))
            (p (- 1 (if (= df 0) 0 (chisq-cdf dev df))))
		
             )
        (send self :flush-window)
      (cond 
             ((equal (first args) "terms")
		(send v-log-lin-proto :print-fit-information w)
			)
	        ((equal (first args) "dev-plot")
			(let ((cur-model (car
                                    (select
                                     (send v-log-lin-proto :models-adjusted-list) 
                                     selection)))
				)
			 (cond 
                		((= (length selection) 1)                   
                		(send v-log-lin-proto :print-fit-information w)
                                 )
              		  ((= (length selection) 2)
                			 (send self :flush-window)
                				 

                          (add-text w 
                                    (strcat 
                                     (format nil "Nested models ~%Difference ~,5g df'  ~d p= ~,5f "
                                             (- first-dev second-dev)                             
                                             (abs (- first-coefs second-coefs))
                                                  chi
                                                  )))))
                   (t (add-text w "Non-Nested Models")))
                          )))))))|#